<template>
    <div>
        <div
            style="display: flex; width: 800px; height: 40px; line-height: 40px"
        >
            <span style="color: red">*</span><span>角色名称</span>
            <el-input v-model="roleName"></el-input>
        </div>
        <div style="margin-top:10px;margin-left:40px">
            <el-button type="primary">保存</el-button>
            <el-button type="info">取消</el-button>
        </div>
    </div>
</template>

<script>
export default {
    data(){
        return{
            id:'',
            roleName:''
        }
    },
    methods:{
        async getRole(){
            const res = await this.api.role.getRole({},this.id);
            console.log(res);
            if(res.code){
                this.roleName = res.data.item.roleName;
            }
        }
    },
    created(){
        console.log(this.$route.params.id);
        this.id = this.$route.params.id;
        this.getRole();

    }
}
</script>

<style lang="scss" scoped>
.el-input {
    width: 600px;
    margin-left: 10px;
}
</style>